package controllers

import javax.inject.{Inject, Singleton}
import model.primary.{SwiftFormatUtils, SwiftController}
import model.vo.StandardSuccessResponse
//import model.primary.{SimpleFormatUtils, SwiftController}
//import model.vo.StandardSuccessResponse
import play.api.mvc.{
  AbstractController,
  Action,
  AnyContent,
  ControllerComponents
}
import services.helpers.MySourceCodeGenerator

import scala.concurrent.ExecutionContext

@Singleton
class HelpersController @Inject()(
  private val cc: ControllerComponents,
  private val mySourceCodeGenerator: MySourceCodeGenerator
)(implicit ec: ExecutionContext)
    extends SwiftController(cc)
    with SwiftFormatUtils {

  def tables: Action[AnyContent] = () => {
    mySourceCodeGenerator
      .initializeTables()
      .map(result => StandardSuccessResponse(result))
  }
}
